--- 9base-6.org/bc/bc.y	2014-08-14 22:49:08.870556001 +0200
+++ 9base-6/bc/bc.y	2014-08-15 01:10:42.396569431 +0200
@@ -4,7 +4,6 @@
 	#include	<bio.h>
 
 	#define	bsp_max	5000
-
 	Biobuf	*in;
 	Biobuf	bstdin;
 	Biobuf	bstdout;
@@ -66,7 +65,7 @@
 	int	cflag;
 	int	sflag;
 
-	char*	bundle(int, ...);
+	char*	bundle(void*, int, ...);
 	void	conout(char*, char*);
 	int	cpeek(int, int, int);
 	int	getch(void);
@@ -74,9 +73,9 @@
 	char*	getf(char*);
 	void	getout(void);
 	void	output(char*);
-	void	pp(char*);
+	void	pp(void*, char*);
 	void	routput(char*);
-	void	tp(char*);
+	void	tp(void*, char*);
 	void	yyerror(char*, ...);
 	int	yyparse(void);
 
@@ -91,7 +90,7 @@
 }
 
 %type	<cptr>	pstat stat stat1 def slist dlets e ase nase
-%type	<cptr>	slist re fprefix cargs eora cons constant lora
+%type	<cptr>	re fprefix cargs eora cons constant lora
 %type	<cptr>	crs
 
 %token	<cptr>	LETTER EQOP _AUTO DOT
@@ -118,7 +117,7 @@
 	}
 |	def dargs ')' '{' dlist slist '}'
 	{
-		ttp = bundle(6, pre, $6, post , "0", numb[lev], "Q");
+		ttp = bundle(&yyval, 6, pre, $6, post , "0", numb[lev], "Q");
 		conout(ttp, (char*)$1);
 		rcrs = crs;
 		output("");
@@ -134,72 +133,72 @@
 |	nase
 	{
 		if(sflag)
-			bundle(2, $1, "s.");
+			bundle(&yyval, 2, $1, "s.");
 	}
 
 pstat:
 	stat1
 	{
 		if(sflag)
-			bundle(2, $1, "0");
+			bundle(&yyval, 2, $1, "0");
 	}
 |	nase
 	{
 		if(!sflag)
-			bundle(2, $1, "ps.");
+			bundle(&yyval, 2, $1, "ps.");
 	}
 
 stat1:
 	{
-		bundle(1, "");
+		bundle(&yyval, 1, "");
 	}
 |	ase
 	{
-		bundle(2, $1, "s.");
+		bundle(&yyval, 2, $1, "s.");
 	}
 |	SCALE '=' e
 	{
-		bundle(2, $3, "k");
+		bundle(&yyval, 2, $3, "k");
 	}
 |	SCALE EQOP e
 	{
-		bundle(4, "K", $3, $2, "k");
+		bundle(&yyval, 4, "K", $3, $2, "k");
 	}
 |	BASE '=' e
 	{
-		bundle(2, $3, "i");
+		bundle(&yyval, 2, $3, "i");
 	}
 |	BASE EQOP e
 	{
-		bundle(4, "I", $3, $2, "i");
+		bundle(&yyval, 4, "I", $3, $2, "i");
 	}
 |	OBASE '=' e
 	{
-		bundle(2, $3, "o");
+		bundle(&yyval, 2, $3, "o");
 	}
 |	OBASE EQOP e
 	{
-		bundle(4, "O", $3, $2, "o");
+		bundle(&yyval, 4, "O", $3, $2, "o");
 	}
 |	QSTR
 	{
-		bundle(3, "[", $1, "]P");
+		bundle(&yyval, 3, "[", $1, "]P");
 	}
 |	_BREAK
 	{
-		bundle(2, numb[lev-bstack[bindx-1]], "Q");
+		bundle(&yyval, 2, numb[lev-bstack[bindx-1]], "Q");
 	}
 |	_PRINT e
 	{
-		bundle(2, $2, "ps.");
+		bundle(&yyval, 2, $2, "ps.");
 	}
 |	_RETURN e
 	{
-		bundle(4, $2, post, numb[lev], "Q");
+		bundle(&yyval, 4, $2, post, numb[lev], "Q");
 	}
 |	_RETURN
 	{
-		bundle(4, "0", post, numb[lev], "Q");
+		bundle(&yyval, 4, "0", post, numb[lev], "Q");
 	}
 |	'{' slist '}'
 	{
@@ -207,28 +206,28 @@
 	}
 |	FFF
 	{
-		bundle(1, "fY");
+		bundle(&yyval, 1, "fY");
 	}
 |	_IF crs BLEV '(' re ')' stat
 	{
 		conout($7, $2);
-		bundle(3, $5, $2, " ");
+		bundle(&yyval, 3, $5, $2, " ");
 	}
 |	_WHILE crs '(' re ')' stat BLEV
 	{
-		bundle(3, $6, $4, $2);
+		bundle(&yyval, 3, $6, $4, $2);
 		conout($$, $2);
-		bundle(3, $4, $2, " ");
+		bundle(&yyval, 3, $4, $2, " ");
 	}
 |	fprefix crs re ';' e ')' stat BLEV
 	{
-		bundle(5, $7, $5, "s.", $3, $2);
+		bundle(&yyval, 5, $7, $5, "s.", $3, $2);
 		conout($$, $2);
-		bundle(5, $1, "s.", $3, $2, " ");
+		bundle(&yyval, 5, $1, "s.", $3, $2, " ");
 	}
 |	'~' LETTER '=' e
 	{
-		bundle(3, $4, "S", $2);
+		bundle(&yyval, 3, $4, "S", $2);
 	}
 
 fprefix:
@@ -238,7 +237,7 @@
 	}
 
 BLEV:
-	=
+	'='
 	{
 		--bindx;
 	}
@@ -247,7 +246,7 @@
 	stat
 |	slist tail stat
 	{
-		bundle(2, $1, $3);
+		bundle(&yyval, 2, $1, $3);
 	}
 
 tail:
@@ -260,31 +259,31 @@
 re:
 	e EQ e
 	{
-		$$ = bundle(3, $1, $3, "=");
+		$$ = bundle(&yyval, 3, $1, $3, "=");
 	}
 |	e '<' e
 	{
-		bundle(3, $1, $3, ">");
+		bundle(&yyval, 3, $1, $3, ">");
 	}
 |	e '>' e
 	{
-		bundle(3, $1, $3, "<");
+		bundle(&yyval, 3, $1, $3, "<");
 	}
 |	e NE e
 	{
-		bundle(3, $1, $3, "!=");
+		bundle(&yyval, 3, $1, $3, "!=");
 	}
 |	e GE e
 	{
-		bundle(3, $1, $3, "!>");
+		bundle(&yyval, 3, $1, $3, "!>");
 	}
 |	e LE e
 	{
-		bundle(3, $1, $3, "!<");
+		bundle(&yyval, 3, $1, $3, "!<");
 	}
 |	e
 	{
-		bundle(2, $1, " 0!=");
+		bundle(&yyval, 2, $1, " 0!=");
 	}
 
 nase:
@@ -294,19 +293,19 @@
 	}
 |	cons
 	{
-		bundle(3, " ", $1, " ");
+		bundle(&yyval, 3, " ", $1, " ");
 	}
 |	DOT cons
 	{
-		bundle(3, " .", $2, " ");
+		bundle(&yyval, 3, " .", $2, " ");
 	}
 |	cons DOT cons
 	{
-		bundle(5, " ", $1, ".", $3, " ");
+		bundle(&yyval, 5, " ", $1, ".", $3, " ");
 	}
 |	cons DOT
 	{
-		bundle(4, " ", $1, ".", " ");
+		bundle(&yyval, 4, " ", $1, ".", " ");
 	}
 |	DOT
 	{
@@ -314,176 +313,176 @@
 	}
 |	LETTER '[' e ']'
 	{
-		bundle(3, $3, ";", geta($1));
+		bundle(&yyval, 3, $3, ";", geta($1));
 	}
 |	LETTER INCR
 	{
-		bundle(4, "l", $1, "d1+s", $1);
+		bundle(&yyval, 4, "l", $1, "d1+s", $1);
 	}
 |	INCR LETTER
 	{
-		bundle(4, "l", $2, "1+ds", $2);
+		bundle(&yyval, 4, "l", $2, "1+ds", $2);
 	}
 |	DECR LETTER
 	{
-		bundle(4, "l", $2, "1-ds", $2);
+		bundle(&yyval, 4, "l", $2, "1-ds", $2);
 	}
 |	LETTER DECR
 	{
-		bundle(4, "l", $1, "d1-s", $1);
+		bundle(&yyval, 4, "l", $1, "d1-s", $1);
 	}
 |	LETTER '[' e ']' INCR
 	{
-		bundle(7, $3, ";", geta($1), "d1+" ,$3, ":" ,geta($1));
+		bundle(&yyval, 7, $3, ";", geta($1), "d1+" ,$3, ":" ,geta($1));
 	}
 |	INCR LETTER '[' e ']'
 	{
-		bundle(7, $4, ";", geta($2), "1+d", $4, ":", geta($2));
+		bundle(&yyval, 7, $4, ";", geta($2), "1+d", $4, ":", geta($2));
 	}
 |	LETTER '[' e ']' DECR
 	{
-		bundle(7, $3, ";", geta($1), "d1-", $3, ":", geta($1));
+		bundle(&yyval, 7, $3, ";", geta($1), "d1-", $3, ":", geta($1));
 	}
 |	DECR LETTER '[' e ']'
 	{
-		bundle(7, $4, ";", geta($2), "1-d", $4, ":" ,geta($2));
+		bundle(&yyval, 7, $4, ";", geta($2), "1-d", $4, ":" ,geta($2));
 	}
 |	SCALE INCR
 	{
-		bundle(1, "Kd1+k");
+		bundle(&yyval, 1, "Kd1+k");
 	}
 |	INCR SCALE
 	{
-		bundle(1, "K1+dk");
+		bundle(&yyval, 1, "K1+dk");
 	}
 |	SCALE DECR
 	{
-		bundle(1, "Kd1-k");
+		bundle(&yyval, 1, "Kd1-k");
 	}
 |	DECR SCALE
 	{
-		bundle(1, "K1-dk");
+		bundle(&yyval, 1, "K1-dk");
 	}
 |	BASE INCR
 	{
-		bundle(1, "Id1+i");
+		bundle(&yyval, 1, "Id1+i");
 	}
 |	INCR BASE
 	{
-		bundle(1, "I1+di");
+		bundle(&yyval, 1, "I1+di");
 	}
 |	BASE DECR
 	{
-		bundle(1, "Id1-i");
+		bundle(&yyval, 1, "Id1-i");
 	}
 |	DECR BASE
 	{
-		bundle(1, "I1-di");
+		bundle(&yyval, 1, "I1-di");
 	}
 |	OBASE INCR
 	{
-		bundle(1, "Od1+o");
+		bundle(&yyval, 1, "Od1+o");
 	}
 |	INCR OBASE
 	{
-		bundle(1, "O1+do");
+		bundle(&yyval, 1, "O1+do");
 	}
 |	OBASE DECR
 	{
-		bundle(1, "Od1-o");
+		bundle(&yyval, 1, "Od1-o");
 	}
 |	DECR OBASE
 	{
-		bundle(1, "O1-do");
+		bundle(&yyval, 1, "O1-do");
 	}
 |	LETTER '(' cargs ')'
 	{
-		bundle(4, $3, "l", getf($1), "x");
+		bundle(&yyval, 4, $3, "l", getf($1), "x");
 	}
 |	LETTER '(' ')'
 	{
-		bundle(3, "l", getf($1), "x");
+		bundle(&yyval, 3, "l", getf($1), "x");
 	}
-|	LETTER = {
-		bundle(2, "l", $1);
+|	LETTER '=' {
+		bundle(&yyval, 2, "l", $1);
 	}
 |	LENGTH '(' e ')'
 	{
-		bundle(2, $3, "Z");
+		bundle(&yyval, 2, $3, "Z");
 	}
 |	SCALE '(' e ')'
 	{
-		bundle(2, $3, "X");
+		bundle(&yyval, 2, $3, "X");
 	}
 |	'?'
 	{
-		bundle(1, "?");
+		bundle(&yyval, 1, "?");
 	}
 |	SQRT '(' e ')'
 	{
-		bundle(2, $3, "v");
+		bundle(&yyval, 2, $3, "v");
 	}
 |	'~' LETTER
 	{
-		bundle(2, "L", $2);
+		bundle(&yyval, 2, "L", $2);
 	}
 |	SCALE
 	{
-		bundle(1, "K");
+		bundle(&yyval, 1, "K");
 	}
 |	BASE
 	{
-		bundle(1, "I");
+		bundle(&yyval, 1, "I");
 	}
 |	OBASE
 	{
-		bundle(1, "O");
+		bundle(&yyval, 1, "O");
 	}
 |	'-' e
 	{
-		bundle(3, " 0", $2, "-");
+		bundle(&yyval, 3, " 0", $2, "-");
 	}
 |	e '+' e
 	{
-		bundle(3, $1, $3, "+");
+		bundle(&yyval, 3, $1, $3, "+");
 	}
 |	e '-' e
 	{
-		bundle(3, $1, $3, "-");
+		bundle(&yyval, 3, $1, $3, "-");
 	}
 |	e '*' e
 	{
-		bundle(3, $1, $3, "*");
+		bundle(&yyval, 3, $1, $3, "*");
 	}
 |	e '/' e
 	{
-		bundle(3, $1, $3, "/");
+		bundle(&yyval, 3, $1, $3, "/");
 	}
 |	e '%' e
 	{
-		bundle(3, $1, $3, "%%");
+		bundle(&yyval, 3, $1, $3, "%%");
 	}
 |	e '^' e
 	{
-		bundle(3, $1, $3, "^");
+		bundle(&yyval, 3, $1, $3, "^");
 	}
 
 ase:
 	LETTER '=' e
 	{
-		bundle(3, $3, "ds", $1);
+		bundle(&yyval, 3, $3, "ds", $1);
 	}
 |	LETTER '[' e ']' '=' e
 	{
-		bundle(5, $6, "d", $3, ":", geta($1));
+		bundle(&yyval, 5, $6, "d", $3, ":", geta($1));
 	}
 |	LETTER EQOP e
 	{
-		bundle(6, "l", $1, $3, $2, "ds", $1);
+		bundle(&yyval, 6, "l", $1, $3, $2, "ds", $1);
 	}
 |	LETTER '[' e ']' EQOP e
 	{
-		bundle(9, $3, ";", geta($1), $6, $5, "d", $3, ":", geta($1));
+		bundle(&yyval, 9, $3, ";", geta($1), $6, $5, "d", $3, ":", geta($1));
 	}
 
 e:
@@ -494,14 +493,14 @@
 	eora
 |	cargs ',' eora
 	{
-		bundle(2, $1, $3);
+		bundle(&yyval, 2, $1, $3);
 	}
 
 eora:
 	e
 |	LETTER '[' ']'
 	{
-		bundle(2, "l", geta($1));
+		bundle(&yyval, 2, "l", geta($1));
 	}
 
 cons:
@@ -527,7 +526,7 @@
 	}
 
 crs:
-	=
+	'='
 	{
 		$$ = cp;
 		*cp++ = '<';
@@ -557,21 +556,21 @@
 dargs:
 |	lora
 	{
-		pp((char*)$1);
+		pp(&yyval, (char*)$1);
 	}
 |	dargs ',' lora
 	{
-		pp((char*)$3);
+		pp(&yyval, (char*)$3);
 	}
 
 dlets:
 	lora
 	{
-		tp((char*)$1);
+		tp(&yyval, (char*)$1);
 	}
 |	dlets ',' lora
 	{
-		tp((char*)$3);
+		tp(&yyval, (char*)$3);
 	}
 
 lora:
@@ -809,10 +808,11 @@
 }
 
 char*
-bundle(int a, ...)
+bundle(void *vyyval, int a, ...)
 {
 	int i;
 	char **q;
+	YYSTYPE *yyval = vyyval;
 	va_list arg;
 	
 	i = a;
@@ -827,7 +827,7 @@
 	}
 	*bsp_nxt++ = 0;
 	va_end(arg);
-	yyval.cptr = (char*)q;
+	yyval->cptr = (char*)q;
 	return (char*)q;
 }
 
@@ -883,23 +883,25 @@
 }
 
 void
-pp(char *s)
+pp(void* vyyval, char *s)
 {
+	YYSTYPE *yyval = vyyval;
 	/* puts the relevant stuff on pre and post for the letter s */
-	bundle(3, "S", s, pre);
-	pre = yyval.cptr;
-	bundle(4, post, "L", s, "s.");
-	post = yyval.cptr;
+	bundle(yyval, 3, "S", s, pre);
+	pre = yyval->cptr;
+	bundle(yyval, 4, post, "L", s, "s.");
+	post = yyval->cptr;
 }
 
 void
-tp(char *s)
+tp(void *vyyval, char *s)
 {
+	YYSTYPE *yyval = vyyval;
 	/* same as pp, but for temps */
-	bundle(3, "0S", s, pre);
-	pre = yyval.cptr;
-	bundle(4, post, "L", s, "s.");
-	post = yyval.cptr;
+	bundle(yyval, 3, "0S", s, pre);
+	pre = yyval->cptr;
+	bundle(yyval, 4, post, "L", s, "s.");
+	post = yyval->cptr;
 }
 
 void
